package test.my.com.myapplicationtest.zhe_xian_tu_view.DynamicPathView.draw.DrawControl;

import android.graphics.Canvas;
import android.graphics.Paint;

import test.my.com.myapplicationtest.zhe_xian_tu_view.DynamicPathView.draw.model.RectModel;

/**
 * Author : Cooper
 * Time : 2016/10/9  17:46
 * Description : 矩形control
 */

public class RectControl extends DrawControl {

    private RectModel rectModel;

    public RectControl(Canvas canvas, RectModel rectModel) {
        super(canvas);
        this.rectModel = rectModel;
    }

    @Override
    public void beginDraw() {
        Paint paint = new Paint();
        paint.setColor(rectModel.getColor());
        paint.setStyle(Paint.Style.FILL);
        mCanvas.drawRect(rectModel.getLeftX(),rectModel.getTopY(),rectModel.getRightX(),rectModel.getBottomY(),paint);
    }
}
